#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int splitNum(int num)
    {
        auto nums = to_string(num);
        sort(nums.begin(), nums.end());
        int num1 = 0, num2 = 0;
        for (int i = 0; i < nums.size(); ++i)
        {
            if (i %2)
            {
                num1 = num1 * 10 + (nums[i] - '0');
            }
            else {
                num2 = num2 * 10 + (nums[i] - '0');
            }
        }
        return num1 + num2;
    }
};